package com.team.communication;

public enum ClientRequest {
	//connection
	INITCON("init_connection"),//ok
	ACK("acknowledge"), //ok
	
	// init games
	ASK_EXIST_GAMES("ask_exist_games"),//ok
	
	ASK_CREATE_GAME("create_game"),//ok
	ASK_JOIN_GAME("join_game"),//ok
	ASK_CHOOSE_PAWN("choose_pawn"),//ok
	
	// dice request
	SEND_SCORE_DICES("send_score_dices"),//ok
	
	//Deplacement requests
	SEND_DEPLACEMENT("send_deplacement"), //ok
	SEND_SECRET_PASSAGE("send_secret_passage"), //it is not a priority ok
	SEND_VALIDE_DEPLACEMENT("send_valide_deplacement"),//ok
	
	//Suggestion and accusation requests
	SEND_ACCUSATION("send_accusation"),  		//it is not a priority ok
	SEND_SUGGESTION("send_suggestion"),//ok
	SEND_ASKED_CARD("send_asked_card"),//ok
	RETURN_ASKED_CARD("return_asked_card"), //ok
	RETURN_CARD("return_card")//ok
	;
	
	
	private String description;

	private ClientRequest(String description) {
		this.description = description;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public static ClientRequest getClientRequestFromDescription(String description) {
		if(description.equals("ask_exist_games")) {
			return ASK_EXIST_GAMES;
		}
		else if(description.equals("init_connection")) {
			return INITCON;
		}
		else if(description.equals("create_game")) {
			return ASK_CREATE_GAME;
		}
		else if(description.equals("join_game")) {
			return ASK_JOIN_GAME;
		}else if(description.equals("send_deplacement")) {
				return SEND_DEPLACEMENT;
		}
		else if(description.equals("choose_pawn")) {
				return ASK_CHOOSE_PAWN;
		}else if(description.equals("send_score_dices")) {
				return SEND_SCORE_DICES;
		}else if(description.equals("send_secret_passage")) {
				return SEND_SECRET_PASSAGE;
		}else if(description.equals("send_accusation")) {
				return SEND_ACCUSATION;
		}else if(description.equals("send_suggestion")) {
				return SEND_SUGGESTION;
		}else if(description.equals("send_asked_card")) {
				return SEND_ASKED_CARD;
		}else if(description.equals("return_asked_card")) {
				return RETURN_ASKED_CARD;
		}else if(description.equals("send_valide_deplacement")) {
			return SEND_VALIDE_DEPLACEMENT;
		}else if(description.equals("acknowledge")) {
				return ACK;
		}else if(description.equals("return_card")) {
			return RETURN_CARD;
		}
		else {
			return null;
		}
	}
}
